<%-- 
    Document   : bill_manager
    Created on : Nov 23, 2012, 11:25:20 AM
    Author     : cuoi
--%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" import="java.sql.*"%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>
            Quan ly hoa don
        </title>
        <META http-equiv=Content-Type
              content="text/html; charset=UTF-8">
        <link href="css/index_style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <%
            if (session.getValue("username") == null) {
                response.sendRedirect("admin.jsp");
            }
        %>
        <div id="baby_wrapper_outter">

            <div id="baby_wrapper_inner">
                <jsp:include page="headerAdmin.jsp"/>
                <div id="baby_content_wrapper">

                    <jsp:include page="menuLeftAdmin.jsp"/>


                    <div id="baby_content">
                        <div class="content_section">

                            <c:if test="${requestScope.listBil==null}">
                                <c:redirect url="GetBell"/>
                            </c:if>

                            <table width="700" class="table">
                                <tr>
                                    <th>ID_Cus</th><th>ID_Pro</th><th>Quantity</th><th>Price</th><th>Time</th><th>State</th><th>ID</th><th>Update</th><th>Delete</th>
                                </tr>
                                <tr>
                                <form action="AddBill" method="post">                            
                                    <td><input type="text"  name="id_cus" value="" size="1"></td>
                                    <td><input type="text"  name="id_pro" value="" size="1"></td>
                                    <td><input type="text"  name="quantity" value="" size="2"></td>
                                    <td><input type="text"  name="price" value="" size="2"></td>
                                    <td><input type="text"  name="time" value="" size="6"></td>
                                    <td><input type="text"  name="state" value="" size="4"></td>
                                    <td><input type="text"  name="id" value="" size="1"></td>
                                    <td><input type="submit" name="bt" value="Add"></td>
                                </form>
                                </tr>
                                <c:forEach items="${requestScope.listBil}" var="ad">  
                                    <c:if test="${ad.id!=param.idsua}">
                                        <tr>                                          
                                            <td width="10" height="80" align="center">
                                                ${ad.idcus}                                            
                                            </td>
                                            <td  width="10" height="80" align="center" >
                                                ${ad.idpro}        
                                            </td>
                                            <td  width="10" height="80" align="center" >
                                                ${ad.quan}         
                                            </td>
                                            <td  width="30" height="80" align="center" >
                                                ${ad.price}         
                                            </td>
                                            <td  width="80" height="80" align="center" >
                                                ${ad.time}         
                                            </td>
                                            <td  width="80" height="80" align="center" >
                                                ${ad.state}         
                                            </td>
                                            <td  width="10" height="80" align="center" >
                                                ${ad.id}         
                                            </td>

                                            <td  width="30" height="80" align="center">
                                                <a href="GetBell?idsua=${ad.id}" style=" color: #660033">Update</a>        
                                            </td>                                          
                                            <td  width="80" height="80" align="center">
                                                <a href="delBell?id=${ad.id}" style=" color: #660033">Delete</a>        
                                            </td>                                          
                                        </tr>                                      
                                    </c:if>

                                    <c:if test="${ad.id==param.idsua}">                                          
                                        <tr>
                                        <form action="EditBell" method="post">
                                            <td><input name="id" value="${ad.id}" size="1" maxlength="15" readonly /></td>
                                            <td><input name="id_cus" value="${ad.idcus}" /></td>
                                            <td><input name="id_pro" value="${ad.idpro}" /></td>
                                            <td><input name="quantity" value="${ad.quan}" /></td>
                                            <td><input name="price" value="${ad.price}" /></td>
                                            <td><input name="time" value="${ad.time}" /></td>
                                            <td><input name="state" value="${ad.state}" /></td>

                                            <td><a href="delBell?id=${ad.id}" style=" color: #660033">Delete</a></td>
                                            <td><input type="submit" name="btEdit" value="Edit"/></td>
                                        </form>
                                        </tr>
                                    </c:if>                                         
                                </c:forEach>
                            </table>
                        </div>
                    </div>

                    <div class="cleaner"></div>

                </div> <!-- end of baby_content_wrapper -->

            </div> <!-- end of baby_wrapper_inner -->
        </div> <!-- end of baby_wrapper_outter -->
        <jsp:include page="footerAdmin.jsp"/>
    </body>
</html>

